<?php
include($_SERVER['DOCUMENT_ROOT']."/inc/Function_index.php");
$catlist = catelist();
$psize = 16;
$page = isset($_GET['page'])?intval($_GET['page']):1;
$keyword = isset($_GET['key'])?trim($_GET['key']):"";
$list = searchlist($page,$psize,$keyword);
if($list){
    $msg=1;
}else{
    $msg=0;
}
$num = searchnum($keyword);
$page1 = page1($num,$psize,$page,$_SERVER['PHP_SELF']."?key=$keyword");

$tpl->assign("slist",$list);
$tpl->assign('results',$results);
$tpl->assign('keyword',$keyword);
$tpl->assign("msg",$msg);
$tpl->assign("page",$page1);
$tpl->show("search");
?>